{if !defined('COMMON')}{include file="base/common" /}{/if}

<style>
    .filter .item{
        display: inline;
    }
</style>
<div class="filter">
    <form action="{$filter.href|default=''}" id="filter_form">
        {foreach $filter.items as $key=>$item }
        {if isset($item.type) && $item.type === "datetime_range"}<div class="item">
        <label for="{$item.code}">{$item.title}</label>
            <input type="text" id="{$item.code}" name="{$item.code}[start]" placeholder="{$item.describe}" value="{$item.value.start}">
            -
            <input type="text" id="{$item.code}" name="{$item.code}[end]" placeholder="{$item.describe}" value="{$item.value.end}">
        </div>
        {else/}
        <div class="item">
            <label for="{$item.code}">{$item.title}</label>
            <input type="text" id="{$item.code}" name="{$item.code}" placeholder="{$item.describe}" value="{$item.value}">
        </div>
        {/if}
        {/foreach}
        <button type="submit">查找</button>
        <a href="{:url()}">清空</a>
        
        {if isset($filter_actions)}
        <p>
            <span>对匹配项目执行:</span>
            {foreach $filter_actions as $key=>$action}
            <button type="button" data-action="{$action.href}" data-confirm="{$action.confirm}" onclick="submit_filter(this)" title="{$action.describe}">{$action.title}</button>
            {/foreach}
        </p>
        {/if}
    </form>
</div>
